<?php
session_start();
require_once('include/connect.inc.php');
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Model Test Program</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
ข้อสอบจับคู่!!! คับผม....*-*
<table width="401" border="1">
    <tr>
      <td width="187">คำถาม</td>
      <td width="198">คำตอบ</td>
    </tr>
<?php 
	$queryQ= query("SELECT * FROM tb_question where match_set=4  order by RAND()");
		while ($rs = fetch_array($queryQ)) {
			$question_id=$rs['question_id'];
			$question_detail=$rs['question_detail'];
?>
    <tr>
		<td><?php echo "$question_detail";?></td>
      	<td><?php //echo "$choice_detail";?>
      	  <select name="select" id="select">
          <option value="0">---เลือกคำตอบ---</option>
<?php 
	$queryC= query("SELECT * FROM tb_choice where match_set=4 order by RAND()");
		while ($rs = fetch_array($queryC)) {
			$choice_id=$rs['choice_id'];
			$choice_detail=$rs['choice_detail'];
?>
          <option value="<?php echo "$choice_id";?>"><?php echo "$choice_detail";?></option>
<?php }?>
   	      </select>
       </td>
    </tr>
<?php }?>
  </table>
</form>
</body>
</html>